from django.urls import path
from . import views
from rest_framework.routers import SimpleRouter

rou = SimpleRouter()
# 登录
rou.register('', views.LoginView, 'login')
# 展示职位
rou.register('', views.UtilView, 'userchoice')
# 分页展示用户信息
rou.register('showuser', views.ShowUserView, 'showuser')
# 获取当前登录用户的信息
rou.register('', views.CurrentUserView, 'currentuser')
# 展示部门的信息
rou.register('showpart', views.ShowPartView, 'showpart')
# 创建部门的路由
rou.register('', views.AdminCreateView, 'createpart')
# 职位的路由
rou.register('position', views.PositionView, 'position')
# 为了创建职位，需要的部门信息
rou.register('partforposition', views.PartForPositionView, 'partforposition')
# 用户管理/用户信息，展示用户信息
rou.register('usermessage', views.UserMessageView, 'usermessage')
# 管理员更新用户信息
rou.register('updateuser', views.UpdateUserView, 'updateuser')
# 登录用户修改密码
rou.register('', views.EditPasswordView, 'password')
# 个人中心的数据
rou.register('personcenter', views.PersonCenterView, 'personcenter')



# 员工获取部门通知
urlpatterns = [
    path('createuser/', views.CreateUserView.as_view(), name='createuser'),
    path('personupdate/', views.PersonCenterUpdateview.as_view(), name='personupdate'),
    # 日志信息
    path('logdata/', views.LogDataView.as_view(), name='logdata'),
    path('companymessage/', views.AdminCompanyMessage.as_view(), name='companymessage'),
    path('partmessage/', views.PartMessageView.as_view(), name='partmessage'),
    path('companyfile/', views.CompanyFileView.as_view()),
    path('downloadfile/', views.DownloadFileView.as_view(), name='downloadfile'),
    # 日志文件数据写到数据库中，用来进行分析的
    path('logintodb/', views.TestView.as_view()),
    # path('testview/',views.TestViewFunction.as_view({'get':'list'}))
    path('staffmessage/', views.StaffMessageView.as_view({'get': 'list'})),
    # 测试在线预览word文档
    path('word/', views.PdfUrlView.as_view()),
    path('evection/', views.CreateEvectionView.as_view({'get': 'list', 'post': 'create', 'delete': 'destroy'})),
    # 审核测试
    path('checkevection/', views.ManageEvectionView.as_view({'get': 'list', 'patch': 'update'})),
    # 加班申请
    path('extrawork/',
         views.ExtraWorkView.as_view({'get': 'list', 'post': 'create', 'patch': 'update', 'delete': 'destroy'})),
    # 审核加班
    path('checkextrawork/', views.ManageExtraWorkView.as_view({'get': 'list', 'patch': 'update'})),
    # 创建车辆
    path('createcar/',
         views.CreateCarView.as_view({'get': 'list', 'post': 'create', 'patch': 'update', 'delete': 'destroy'})),
    #申请用车
    path('applycar/',
         views.ApplyCarView.as_view({'get': 'list',   'delete': 'destroy','post':'create','patch':'update'})),
    #申请报销
    path('applyreim/',views.ApplyReimView.as_view({'get': 'list',   'delete': 'destroy','post':'create','patch':'update'})),
    #人事档案管理
    path('record/',views.ManageRecordView.as_view({'get': 'list',   'delete': 'destroy','post':'create'})),
    #下载档案的文件
    path('downrecord/',views.DownloadRecordFileView.as_view()),
    #合同
    path('constract/',views.ManageConstractView.as_view({'get': 'list',   'delete': 'destroy','post':'create'})),
    #下载合同文件
    path('downconstract/',views.DownloadConstractFileView.as_view()),
    #转正需要的部门/职位
    path('partforpositive/',views.PartForPositive.as_view({'get':'list'})),
    #员工转正
    path('positive/',views.PositiveView.as_view({'get':'list','patch':'update'})),
    #会议室的
    path('conference/',views.ConferenceView.as_view({'get':'list','post':'create', 'delete': 'destroy','patch':'update'})),
    #申请会议室
    path('applyconference/',views.ApplyConferenceView.as_view({'get':'list','post':'create', 'delete': 'destroy'})),
    #会议审核
    path('checkconference/',views.CheckConferenceView.as_view({'get':'list','patch':'update'})),
#找回密码，修改密码
    path('checkemail/',views.UtilFindPasswordView.as_view()),
    #通讯录
    path('addresslist/',views.AddressListView.as_view({'get':'list'})),
    #项目的路由
    path('task/',views.TaskView.as_view({'get':'list','post':'create','delete':'destroy','patch':'update'})),
    path('downtask/',views.DownloadTaskFileView.as_view()),
    #展示项目的详细情况
    path('detailtask/',views.TaskDetailView.as_view({'get':'list','post':'create'})),
    #操作第三张表，
    path('tasktodetail/',views.TaskToDetailView.as_view({'get':'list'})),
    #获取员工任务的等级
    path('level/',views.LevelForTaskView.as_view({'get':'list'})),
    #获取执行员工任务的员工信息
    path('stafffortask/',views.StaffForTaskView.as_view({'get':'list'})),
    #员工个人的任务
    path('persontask/',views.PersonTaskView.as_view({'get':'list','post':'create','delete':'destroy','patch':'update'})),
    #员工任务的文件下载
    path('persontaskdown/',views.DownloadPersonTaskFileView.as_view()),
    #员工个人任务的详细情况
    path('persontaskdetail/',views.PersonTaskDetailView.as_view({
        'get':'list','post':'create'})),
    #员工查看个人任务
    path('staffpersontask/',views.StaffPersonTaskView.as_view({'get':'list'})),
    #财务部，设置员工工资
    path('partsalary/',views.SalaryPartUser.as_view({'get':'list','post':'create'})),
    #财务经理获取员工工资
    path('onesalary/',views.SalaryForPart.as_view({'get':'retrieve','post':'create'})),
    #员工查看自己的工资信息
    path('staffsalary/',views.StaffSalaryView.as_view({'get':'list','post':'search'})),
    #员工签到功能
    path('staffsignin/',views.StaffSignIn.as_view({'get':'retrieve','post':'create','patch':'update'})),
    #员工管理签到功能
    path('showstaffsign/',views.ShowStaffSign.as_view({'get':'list'})),
    #修改上班下班的时间
    path('editsigntime/',views.EditeSignTime.as_view({'get':'retrieve','put':'update'})),
    #每月的签到次数
    path('monthsigncount/',views.MonthSignCountView.as_view({'get':'list','put':'update','post':'create'}))





]
urlpatterns += rou.urls
